<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>{{ $.Site.Title }} | {{ $.Site.Params.Subtitle }}</title>
    <meta name="description" content="{{ $.Site.Params.Subtitle }}">
    <link rel="shortcut icon" href="{{ $.Site.Params.cdn }}/images/eduifuns.png">
    <link rel="stylesheet" href="{{ $.Site.Params.cdn }}/css/icomoon.css">
    <link rel="stylesheet" href="{{ $.Site.Params.cdn }}/css/style.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Arimo:400,700,400italic" media="print" onload="this.media='all'">
  </head>

<body class="page-body">
    <!-- skin-white -->
    <div class="page-container">
        <div class="sidebar-menu toggle-others fixed">
            <div class="sidebar-menu-inner">
                <header class="logo-env">
                    <!-- logo -->
                    <div class="logo">
                        <a href="{{ $.Site.BaseURL }}" class="logo-expanded">
                            <img src="{{ $.Site.Params.logo }}"  style="height:68px" alt="" />
                        </a>
                        <a href="{{ $.Site.BaseURL }}" class="logo-collapsed">
                            <img src="{{ $.Site.Params.logoM }}" width="40" alt="" />
                        </a>
                    </div>
                    <div class="mobile-menu-toggle visible-xs">
                        <a href="#" data-toggle="mobile-menu">
                            <i class="icon-bar"></i>
                        </a>
                    </div>
                </header>
                <ul id="main-menu" class="main-menu">
                    {{ range .Site.Data.links.list }}
                    {{if .sub}}
                    <li class="has-sub">
                        <a>
                            <i class="{{.css}}"></i>
                            <span class="title">{{.tag}}</span>
                        </a>
                        <ul>
                            {{range .sub}}
                            <li>
                                <a href="javascript:" class="smooth" data-tag="#{{.tag}}">
                                    <i class="{{.css}}"></i>
                                    <span class="title">{{.tag}}</span>
                                </a>
                            </li>
                            {{ end }}
                        </ul>
                    </li>
                    {{ else }}
                    <li>
                        <a href="javascript:" class="smooth" data-tag="#{{.tag}}">
                            <i class="{{.css}}"></i>
                            <span class="title">{{.tag}}</span>
                        </a>
                    </li>
                    {{ end }}
                    {{ end }}
                </ul>
            </div>
        </div>
        <div class="main-content">
            <nav class="navbar user-info-navbar" role="navigation">
                <!-- User Info, Notifications and Menu Bar -->
                <!-- Left links for user info navbar -->
                <ul class="user-info-menu left-links list-inline list-unstyled">
                    <li class="hidden-sm hidden-xs">
                        <a href="#" data-toggle="sidebar">
                            <i class="icon-bar"></i>
                        </a>
                    </li>
                </ul>
            </nav>

            {{if eq $.Site.Params.jinrishici "true"}}
            <!-- 今日诗词 -->
            <div id="poem_content">
                <h3 id="poem_sentence"></h3><span id="poem_info"></span>
            </div>
            <!-- 今日诗词 -->
            {{ else }}
            <br/><br/>
            {{ end }}

            {{ range .Site.Data.links.list }}
            {{if .sub}}
            {{range .sub}}
            <h4 class="text-gray"><i class="{{.css}}" style="margin-right: 7px;" id="{{.tag}}"></i>{{.tag}}</h4>
            <div class="row">
                {{range .item}}
                <div class="col-sm-3">
                    {{if .siteImage}}
                    <div class="xe-widget xe-conversations box2 label-info" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="<img src='{{.siteImage}}' width='148'>">
                    {{ else }}
                    <div class="xe-widget xe-conversations box2 label-info" onclick="window.open('{{.siteLink}}', '_blank')" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="{{.siteLink}}">
                    {{ end }}
                        <div class="xe-comment-entry">
                            <a class="xe-user-img">
                                {{if .siteLogo}}
                                    <img data-src="{{.siteLogo}}"  class="lozad img-circle" width="40">
                                {{ else }}
                                    <img avatar="{{.siteName}}"  class="lozad img-circle" width="40">
                                {{ end }}    
                            </a>
                            <div class="xe-comment">
                                <a href="#" class="xe-user-name overflowClip_1">
                                    <strong>{{.siteName}}</strong>
                                </a>
                                <p class="overflowClip_2">{{.description}}</p>
                            </div>
                        </div>
                    </div>
                </div>
                {{ end }}
            </div>
            <br />
            {{end}}
            {{ else }}
            <h4 class="text-gray"><i class="{{.css}}" style="margin-right: 7px;" id="{{.tag}}"></i>{{.tag}}
            </h4>
            <div class="row">
                {{range .item }}
                <div class="col-sm-3">
                    {{if .siteImage}}
                    <div class="xe-widget xe-conversations box2 label-info" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="<img src='{{.siteImage}}' width='148'>">
                    {{ else }}
                    <div class="xe-widget xe-conversations box2 label-info" onclick="window.open('{{.siteLink}}', '_blank')" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="{{.siteLink}}">
                    {{ end }}
                        <div class="xe-comment-entry">
                            <a class="xe-user-img">
                                {{if .siteLogo}}
                                <img data-src="{{.siteLogo}}"  class="lozad img-circle" width="40">
                                {{ else }}
                                <img avatar="{{.siteName}}"  class="lozad img-circle" width="40">
                                {{ end }}
                            </a>
                            <div class="xe-comment">
                                <a href="#" class="xe-user-name overflowClip_1">
                                    <strong>{{.siteName}}</strong>
                                </a>
                                <p class="overflowClip_2">{{.description}}</p>
                            </div>
                        </div>
                    </div>
                </div>
                {{ end }}
            </div>
            {{ end }}
            <br />
            {{ end }}

            <!-- Main Footer -->
            <!-- Choose between footer styles: "footer-type-1" or "footer-type-2" -->
            <!-- Add class "sticky" or "fixed" -->
            <footer class="main-footer sticky footer-type-1">
                <div class="footer-inner">
                    <!-- Add your copyright text here -->
                    <div class="footer-text">
                        @2020 Edui.fun 
                        {{if eq $.Site.Params.busuanzi "true"}}
                        <span id="busuanzi_container_site_pv" style='display:none'>总访问量 <span id="busuanzi_value_site_pv"></span> 次</span>
                        {{end}}
                    </div>
                    <div class="go-up">
                        <a href="#" rel="go-top">
                            <i class="icon-up"></i>
                        </a>
                    </div>
                </div>
            </footer>
        </div>
    </div>

    {{if eq $.Site.Params.jinrishici "true"}}
    <script src="//sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8"></script>
    <script type="text/javascript">
    jinrishici.load(function(result) {
        var sentence = document.querySelector("#poem_sentence")
        var info = document.querySelector("#poem_info")
        sentence.innerHTML = result.data.content
        info.innerHTML = '【' + result.data.origin.dynasty + '】' + result.data.origin.author + '《' + result.data.origin.title + '》'
    });
    </script>
    {{end}}

    {{if eq $.Site.Params.busuanzi "true"}}
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    {{end}}

    <script src="https://cdn.staticfile.org/jquery/1.11.1/jquery.min.js"></script>
    <!-- 锚点平滑移动 -->
    <script type="text/javascript">
    $(document).ready(function() {
         //img lazy loaded
         const observer = lozad();
         observer.observe();

        $(document).on('click', '.has-sub', function(){
            var _this = $(this)
            if(!$(this).hasClass('expanded')) {
               setTimeout(function(){
                    _this.find('ul').attr("style","")
               }, 300);
              
            } else {
                $('.has-sub ul').each(function(id,ele){
                    var _that = $(this)
                    if(_this.find('ul')[0] != ele) {
                        setTimeout(function(){
                            _that.attr("style","")
                        }, 300);
                    }
                })
            }
        })
        $('.user-info-menu .hidden-sm').click(function(){
            if($('.sidebar-menu').hasClass('collapsed')) {
                $('.has-sub.expanded > ul').attr("style","")
            } else {
                $('.has-sub.expanded > ul').show()
            }
        })
        $("#main-menu li ul li").click(function() {
            $(this).siblings('li').removeClass('active'); // 删除其他兄弟元素的样式
            $(this).addClass('active'); // 添加当前元素的样式
        });
        $("a.smooth").click(function(ev) {
            ev.preventDefault();

            public_vars.$mainMenu.add(public_vars.$sidebarProfile).toggleClass('mobile-is-visible');
            ps_destroy();
            $("html, body").animate({
                scrollTop: $($(this).attr("data-tag")).offset().top - 30
            }, {
                duration: 500,
                easing: "swing"
            });
        });
        return false;
    });

    var href = "";
    var pos = 0;
    $("a.smooth").click(function(e) {
        $("#main-menu li").each(function() {
            $(this).removeClass("active");
        });
        $(this).parent("li").addClass("active");
        e.preventDefault();
        href = $(this).attr("data-tag");
        pos = $(href).position().top - 30;
    });
    </script>	
    <!-- Bottom Scripts -->

<script src="{{ $.Site.Params.cdn }}/js/bootstrap.min.js"></script>
<script src="{{ $.Site.Params.cdn }}/js/TweenMax.min.js"></script>
<script src="{{ $.Site.Params.cdn }}/js/resizeable.js"></script>
<script src="{{ $.Site.Params.cdn }}/js/xenon-toggle.js"></script>
<script src="{{ $.Site.Params.cdn }}/js/xenon-custom.js"></script>
<script src="{{ $.Site.Params.cdn }}/js/lozad.js"></script>
<script src="{{ $.Site.Params.cdn }}/js/LetterAvatar.js"></script>

</body>
</html>